package com.itheima.mapper;

import com.itheima.dto.Page;
import com.itheima.pojo.OperateLog;
import com.itheima.vo.OperateLogVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface OperateLogMapper {
    @Insert("insert into operate_log" +
            " (operate_user,operate_time,class_name,method_name,method_params,return_value,cost_time)" +
            "values (#{operateUser},#{operateTime},#{className},#{methodName},#{methodParams},#{returnValue},#{costTime})")
    public void insert(OperateLog operateLog);


    List<OperateLogVo> pageQuery(Page page);

    @Select("select count(1) from operate_log")
    Integer count();
}
